//
//  UITextInputTraits.swift
//  Documentation
//
//  Created by Toj on 1/17/23.
//

public protocol UITextInputTraits : NSObjectProtocol {
    
    // 文本大小写样式
    optional var autocapitalizationType: UITextAutocapitalizationType = .sentences

    // 设置是否启动自动提醒更正功能
    optional var autocorrectionType: UITextAutocorrectionType = .default

    // 拼写检查设置
    @available(iOS 5.0, *)
    optional var spellCheckingType: UITextSpellCheckingType { get set } // default is UITextSpellCheckingTypeDefault;

    // 智能引号的配置状态
    // 用于控制中文和英文引号的自动转换.
    @available(iOS 11.0, *)
    optional var smartQuotesType: UITextSmartQuotesType { get set } // default is UITextSmartQuotesTypeDefault;

    // 智能短划线的配置状态
    @available(iOS 11.0, *)
    optional var smartDashesType: UITextSmartDashesType { get set } // default is UITextSmartDashesTypeDefault;
    
// 智能插入和删除空格字符的配置状态
    @available(iOS 11.0, *)
    optional var smartInsertDeleteType: UITextSmartInsertDeleteType { get set } // default is UITextSmartInsertDeleteTypeDefault;

    // 键盘类型
    optional var keyboardType: UIKeyboardType { get set }

    // 键盘外观
    optional var keyboardAppearance: UIKeyboardAppearance { get set } // default is UIKeyboardAppearanceDefault

    // return键 类型
    optional var returnKeyType: UIReturnKeyType { get set } // default is UIReturnKeyDefault (See note under UIReturnKeyType enum)

    // 是否在无文本时禁用Return键, 默认: false
    // 若为YES, 则用户至少输入一个字符后Return键才被激活
    optional var enablesReturnKeyAutomatically: Bool { get set } // default is NO (when YES, will automatically disable return key when text widget has zero-length contents, and will automatically enable when text widget has non-zero-length contents)

    // 是否以密码形式显示. 默认: false
    optional var isSecureTextEntry: Bool = false

    
    // The textContentType property is to provide the keyboard with extra information about the semantic intent of the text document.
    @available(iOS 10.0, *)
    optional var textContentType: UITextContentType! { get set } // default is nil

    
    // The passwordRules property is used to communicate requirements for passwords for your service
    // to ensure iOS can generate compatible passwords for users. It only works when secureTextEntry
    // is YES. You do not need to use this property if the passwords that iOS generates are already
    // compatible with your service. You can learn more about the purpose of and syntax for these rules
    // on the Password Rules documentation guide.
    @available(iOS 12.0, *)
    @NSCopying optional var passwordRules: UITextInputPasswordRules? { get set } // default is nil
}
